﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dpdw.Behaviour.CommandPattern
{
    public class LightOffCommand : ICommand
    {
        private Light light;

        public LightOffCommand(Light light)
        {
            this.name = "LightOffCommand";
            this.light = light;
        }

        public void Execute()
        {
            this.light.Off();
        }

        public void Undo()
        {
            this.light.On();
        }

        private string name;

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }
    }
}
